﻿@page "/diarySetting"
@namespace SwashbucklerDiary.Pages
@inherits ImportantComponentBase

<MyAppBar Title="@(I18n.T("Setting.Display.Diary.Name"))"
          OnClick="NavigateToBack">
</MyAppBar>

<ScrollContainer>
    <MCard Class="setting-card"
           Elevation="0"
           Rounded="@("lg")">
        <MList>
            <MListItem>
                <MListItemIcon>
                    <MIcon Class="list-item-icon">
                        mdi-format-title
                    </MIcon>
                </MListItemIcon>
                <MListItemContent>
                    @(I18n.T("Setting.Display.Diary.Title.Name"))
                </MListItemContent>
                <MListItemAction>
                    <MSwitch @bind-Value="Title"
                             TValue="bool"
                             OnChange="SettingChange(SettingType.Title)"
                             Dense="true"
                             Inset="true"
                             Color="white"
                             TrackColor="@MSwitchTrackColor(Title)">
                    </MSwitch>
                </MListItemAction>
            </MListItem>

            <MDivider Class="mx-3"></MDivider>

            <MListItem>
                <MListItemIcon>
                    <MIcon Class="list-item-icon">
                        mdi-language-markdown-outline
                    </MIcon>
                </MListItemIcon>
                <MListItemContent>
                    @(I18n.T("Setting.Display.Diary.Markdown.Name"))
                </MListItemContent>
                <MListItemAction>
                    <MSwitch @bind-Value="Markdown"
                             TValue="bool"
                             OnChange="SettingChange(SettingType.Markdown)"
                             Dense="true"
                             Inset="true"
                             Color="white"
                             TrackColor="@MSwitchTrackColor(Markdown)">
                    </MSwitch>
                </MListItemAction>
            </MListItem>
        </MList>
    </MCard>

    <MCard Class="setting-card"
           Elevation="0"
           Rounded="@("lg")">
        <MList>
            <MListItem OnClick="@(()=>To("pppp"))">
                <MListItemIcon>
                    <MIcon Class="list-item-icon">
                        mdi-map-marker-outline
                    </MIcon>
                </MListItemIcon>
                <MListItemContent>
                    @(I18n.T("Setting.Display.Diary.Location.Name"))
                </MListItemContent>
                <MListItemAction>
                    <MIcon>mdi-chevron-right</MIcon>
                </MListItemAction>
            </MListItem>
            <MDivider Class="mx-3"></MDivider>

            <MListItem OnClick="@(()=>To("imageSetting"))">
                <MListItemIcon>
                    <MIcon Class="list-item-icon">
                        mdi-image-outline
                    </MIcon>
                </MListItemIcon>
                <MListItemContent>
                    @(I18n.T("Setting.Display.Diary.Image.Name"))
                </MListItemContent>
                <MListItemAction>
                    <MIcon>mdi-chevron-right</MIcon>
                </MListItemAction>
            </MListItem>
        </MList>
    </MCard>
</ScrollContainer>
